package cn.wolfcode.wms.web.controller;

import cn.wolfcode.wms.service.IEmployeeService;
import cn.wolfcode.wms.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CheckLoginController {
    @Autowired
    private IEmployeeService employeeService;
    @RequestMapping("login")
    @ResponseBody
    public AjaxResult login(String username,String password){
        AjaxResult ajaxResult = new AjaxResult();
        try {
            employeeService.login(username,password);
        } catch (Exception e) {
            ajaxResult.mark(e.getMessage());
        }
        return ajaxResult;
    }


    @RequestMapping("main")
    public String main(){
        return "main";
    }

}
